<%@ LANGUAGE="VBSCRIPT" %>
<%
'********************************************************************
' Name: adminHomeInitialBL.asp
'Date Modified	Author				Purpose
'04/21/2003		Gaye Williamson		Build list of setup links
'05/18/2004		Jacinto Gonzalez	Build list of administration links
'03/13/2012		Charlie Espeleta	Add Roles/Rights Look-up Page in Central
'03/19/2012		Charlie Espeleta	145314  Global Updates - Resident Refunds Settings Ver 2.0
'********************************************************************

'********************************************************************
' Include Files
'********************************************************************
%>
<!-- #include virtual="/components/server/centers.inc"-->
<!-- #include virtual='/components/server/deferredrelease.asp' -->
<!-- #include virtual="/components/server/uifeatures.inc"-->
<!-- #include virtual="/components/server/businesslogicserver.inc"-->
<!-- #include virtual="/components/server/getrights.inc"-->
<!-- #include virtual="/components/server/getsiteentityuser.inc"-->
<!-- #include virtual='/components/server/GetSiteSettings.inc' -->
<%
'********************************************************************
' Global Variables
'********************************************************************
dim bNewResFromUI 'passed in in request
dim bFromCentral
dim sScreenVer
dim strXMLReturn9
dim strXMLReturn10
dim strSiteID
dim strUserID
dim strEntityID
dim strResult
dim strSP
dim strXML1
dim strXML2
dim strXML3
dim strXML4
dim strXML5
dim sTempReturn
dim sTimberlineStatus
dim sBlueMoon
dim sAffordableSettings
dim sResidentRefundSettings
dim sTransactionImportSettings
dim sMRISettings
dim sGLJournalSettings
dim sAccountingSDECategory
dim sRenewalsCategory
dim sLockBoxCategory
dim pgID
dim bOSAShared
dim strSP12
dim strSP13
dim sCDIFlag
dim sCKPIFlag

Dim sReportType, sstName, sMasID, sMasShortName, sMasParameterURL, sMasParameterSize
Dim sCategoryName, sMasLongName, sParamString, sRptStoreID

'********************************************************************
'Start of DoBusinessLogic
'********************************************************************
'--------------------------------------------------------------------
' Function: DoBusinessLogic
'
' Purpose: Entry point for the page. Call other subroutines from within
'--------------------------------------------------------------------
function DoBusinessLogic(objXML, strReturn, blUserID, blSiteID, blEntityID)
	ON ERROR RESUME NEXT

	if objXML.xml = "" then exit function

	strSiteID = cStr(blSiteID)
	strUserID = cStr(blUserID)
	strEntityID = cStr(blEntityID)

	If (gInstall_level = "221") Then
		ParseFields(objXML)

		dim oXML,oRow,sSiteVer,oNodes
		set oXML=Server.CreateObject("Microsoft.XMLDOM")
		oXML.async=false

		strSP = "exec uspGetDBVersion " &_
			"@InternalEntityID = '" & strEntityID & "', " &_
			"@InternalUserID = '" & strUserID & "', " &_
			"@InternalSiteID = '" & strSiteID & "'"
		if GetSQLXMLForRead(strSiteID,"Rents",strSP, strXML1) = FALSE then
			strReturn = strXML1
			doBusinessLogic = -1
			Exit Function
		END IF

		call oXML.loadXML("<root><SiteVer>" & strXML1 & "</SiteVer></root>")
		set oRow = oXML.selectSingleNode("root/SiteVer/Row")
		sSiteVer = oRow.getAttribute("c0")

		if sSiteVer="P2" or sSiteVer="P3" then
			strSP = "exec uspRsGSSelect " & _
				"@InternalEntityID = '" & strEntityID & "', " & _
				"@InternalUserID = '" & strUserID & "', " & _
				"@InternalSiteID = '" & strSiteID  & "'"
			If GetSQLXMLForRead(strSiteID,"S"&strSiteID,strSP, strXML3) = FALSE Then
				strReturn = strXML3
				doBusinessLogic = -1
				Exit Function
			End If
		end if

		strSP = "exec uspDataAdapterStatusSelect "  & _
			"@InternalEntityID = '" & strEntityID & "', " & _
			"@InternalUserID = '" & strUserID & "', " & _
			"@InternalSiteID = '" & strSiteID & "'"
		IF GetSQLXMLForRead(strEntityID,"PMC" ,strSP, strXML2) = FALSE THEN
			strReturn = strXML2
			doBusinessLogic = -1
			Exit Function
		END IF

		if bIsTemplate = "" or bIsTemplate = "undefined" then
			bIsTemplate = "0"
		else
			bIsTemplate = left(bIsTemplate,1)
		end if

		if bIsTemplate = "1" then
			strSP = "exec dbo.uspGetUIReportList " &_
				"@InternalEntityID = '" & strEntityID & "', " &_
				"@InternalUserID = '" & strUserID & "', " &_
				"@InternalSiteID = '" & strSiteID & "', " & _
				"@ReportID = 'set-001-001-RealPageSetup'"
			IF GetSQLXMLForRead(strEntityID,"PMC",strSP, strXML4) = FALSE THEN
				strReturn = strXML4
				doBusinessLogic = -1
				Exit Function
			END IF
		end if  ' end if bIsTemplate = 1

		if sSiteVer="P2" or sSiteVer="P3" then
			strSP = "exec uspAccountingSelectSettings "  & _
				"@InternalEntityID = '" & strEntityID & "', " & _
				"@InternalUserID = '" & strUserID & "', " & _
				"@InternalSiteID = '" & strSiteID & "'"
			if GetSQLXMLForRead(strSiteID,"S"&strSiteID ,strSP, strXML5) = FALSE THEN
				strReturn = strXML5
				doBusinessLogic = -1
				Exit Function
			end if

			call oXML.loadXML("<root><Intacct>" & strXML5 & "</Intacct></root>")
			bOSAShared = oXML.selectSingleNode("root/Intacct/Row/@sharedConfiguration").value
			if lcase(bOSAShared) = "true" then
				bOSAShared = "1"
			else
				bOSAShared = "0"
			end if
		else
			bOSAShared = "0"
		end if

		call oXML.loadXML("<root><SiteVer>" & strXML1 & "</SiteVer><DataAdapter>" & strXML2 & "</DataAdapter><RsGSSelect>" & strXML3 & "</RsGSSelect></root>")
		sTimberlineStatus = oXML.selectSingleNode("root/DataAdapter/Row/@TimberlineSettings").value
		sBlueMoon = oXML.selectSingleNode("root/DataAdapter/Row/@BlueMoon").value
		sAffordableSettings = oXML.selectSingleNode("root/DataAdapter/Row/@AffordableSettings").value
		sResidentRefundSettings = oXML.selectSingleNode("root/DataAdapter/Row/@ResidentRefundSettings").value
		sTransactionImportSettings = oXML.selectSingleNode("root/DataAdapter/Row/@TransactionImportSettings").value
		sMRISettings = oXML.selectSingleNode("root/DataAdapter/Row/@MRISettings").value
		sGLJournalSettings = oXML.selectSingleNode("root/DataAdapter/Row/@GLJournalSettings").value
		sAccountingSDECategory = oXML.selectSingleNode("root/DataAdapter/Row/@Accounting").value
		sRenewalsCategory = oXML.selectSingleNode("root/DataAdapter/Row/@Renewals").value
		sLockBoxCategory = oXML.selectSingleNode("root/DataAdapter/Row/@LockBox").value

		doBusinessLogic = 0

		if bIsTemplate <> "1" then 'This section needs to be displayed only if this is not a Business Model - Vinod.
			'WHAT's NEW
			if bFromCentral <> "1" then
				sTempReturn = sTempReturn & "<category label=""Product information"">"
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/ProductInformation.asp' -->
<%
				sTempReturn = sTempReturn & "</category>"
			end if
			pgID=0

			'COMPANY SETUP
			if aright("companysetup") then
				sTempReturn = sTempReturn & "<category label=""Company setup"">"
				if bFromCentral = "1" then
%>
					<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/GeneralInformationAndCompanySettings.asp' -->
<%
				end if

				if bFromCentral <> "1" then
					if sSiteVer="P2" or sSiteVer="P3" then
						pgID=0
						'TEMPLATES
						strSP = "exec spTemplateDetailList " &_
							"@InternalEntityID = '" & strEntityID & "', " &_
							"@InternalUserID = '" & strUserID & "', " &_
							"@InternalSiteID = '" & strSiteID & "'"
						if GetSQLXMLForRead(strSiteID,"SiteMaster",strSP, strXML) then
							dim sTemplateID,sTemplateName,sTemp,sTemplateCompliance
							call oXML.loadXML("<Templates>" & strXML & "</Templates>")
							for each oRow in oXML.documentElement.childNodes
								sTemplateID=oRow.getAttribute("TemplateID")
								sTemplateName=oRow.getAttribute("TemplateName")
								sTemplateCompliance=oRow.getAttribute("Compliance")
							'SPECIFIC TEMPLATE
							sTemplateName=Replace(sTemplateName,"&","&#38;")
							' Add the word Template if it does not already exist in the name - to avoid confusion
							if (instr(lcase(sTemplateName),"template") = 0) then sTemplateName = sTemplateName & " template"
%>
								<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/CorporateTemplates.asp' -->
<%
							next
						else 'ERROR RETRIEVING TEMPLATES
							strReturn = strXML
							doBusinessLogic = -1
							Exit Function
						end if
					end if
				end if
				sTempReturn = sTempReturn & "</category>"
			end if 'end of if aright("companysetup")...
		end if  'end of the bIsTemplate if....

		'GENERAL PROPERTY SETUP
		pgID=0
		if bFromCentral <> "1" then
			sTempReturn = sTempReturn & "<category label=""General property"">"
%>
			<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/GeneralInformationAndPropertySettings.asp' -->
<%

			if sSiteVer="P2" or sSiteVer="P3" then
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/ChartOfAccounts.asp' -->
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/SiteDataExchange.asp' -->
<%
				if bIsTemplate <> "1" then 'This section needs to be displayed only if this is not a Business Model - Vinod.
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/DocMgmt.asp' -->
<%
				end if
%>

<%
				if bIsTemplate <> "1" then 'This section needs to be displayed only if this is not a Business Model - Vinod.
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/LeasingDeskeForms.asp' -->
<%
				end if
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Parts.asp' -->
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Purchasing.asp' -->
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Accounting.asp' -->
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Facilities.asp' -->
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/LeasingAndRents.asp' -->
<%
				if bIsTemplate <> "1" then ' Insurance settings should not be visible from BM 
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/InsuranceServices.asp' -->
<%
				end if 
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/MilitaryHousing.asp' -->
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/StudentLiving.asp' -->
<%
				if sSiteVer="P3" then 'MUST have P3 dbs for compliance!
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Affordable.asp' -->
<%
				end if 'end if P3
			end if 'end if sSiteVer="P2" or sSiteVer="P3"

			if sSiteVer="P1" or sSiteVer="P2" or sSiteVer="P3" then
%>
			<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/seniorliving.asp' -->
<%
			end if
			if sSiteVer="P1" or sSiteVer="P2" or sSiteVer="P3" then
				if bIsTemplate <> "1" then 'This section needs to be displayed only if this is not a Business Model - Vinod.
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Screening.asp' -->
<%
				end if
			end if
			if sSiteVer="P2" or sSiteVer="P3" then
				if bIsTemplate <> "1" then 'This section needs to be displayed only if this is not a Business Model - Vinod.
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/RDNS.asp' -->
<%
				end if
			end if
			if sSiteVer="P2" or sSiteVer="P3" then
				if bIsTemplate <> "1" then 'This section needs to be displayed only if this is not a Business Model - Vinod.
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/RentStab.asp' -->
<%
				end if
			end if
			'' Commercial set up items
			if sSiteVer="P2" or sSiteVer="P3" then
%>
			<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Commercial.asp' -->
			<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Payments.asp' -->
<%
            end if
            
            if bIsTemplate <> "1" then
                if sSiteVer="P2" or sSiteVer="P3" then  
%>
			<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/RevenueManagement.asp' -->
<%          
			    end if
		    end if

			' BDS: Defect: 108680 -- Added new sub category for conversion...
			if bIsTemplate = "1" then 'This section needs to be displayed only if this is a Business Model.
				if sSiteVer="P2" or sSiteVer="P3" then
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Conversion.asp' -->
				
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/RevenueManagement.asp' -->
<%
				end if  ' bIsTemplate = "1"
			end if ' end of if bIsTemplate = "1"

			sTempReturn = sTempReturn & "</category>"

			if bIsTemplate <> "1" then 'This section needs to be displayed only if this is not a Business Model - Vinod.
				if sSiteVer="P2" or sSiteVer="P3" then
					'Addition by Richard Henretta 2/4/04 to add Crossfire support
					sTempReturn = sTempReturn & "<category label=""CrossFire"">"
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Crossfire.asp' -->
<%
					sTempReturn = sTempReturn & "</category>"
				end if
				'End Addition
			end if ' end of if bIsTemplate <> "1"

			sTempReturn = sTempReturn & "<category label=""Velocity"">"
%>
			<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/Velocity.asp' -->
<%
			sTempReturn = sTempReturn & "</category>"

			if aright("internaluser") then
				'REALPAGE SETUP
				sTempReturn = sTempReturn & "<category label=""RealPage setup"">"
%>
				<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/RealpageSetup.asp' -->
<%
				sTempReturn = sTempReturn & "</category>"
			else
				if bIsTemplate = "1" then 'This section needs to be displayed only if this IS a Business Model
					sTempReturn = sTempReturn & "<category label=""RealPage setup"">"
					sTempReturn = sTempReturn & "<subcategory label=""Reports"">"
					call oXML.loadXML("<root>" & strXML4 & "</root>")
					set oNodes = oXML.selectNodes("//root/Row")

					for each oRow in oNodes
						sReportType = oRow.getAttribute("ReportType")
						sstName = oRow.getAttribute("stName")
						sMasID = oRow.getAttribute("masID")
						sMasShortName = oRow.getAttribute("masShortName")
						sMasParameterURL = oRow.getAttribute("masParameterURL")
						sMasParameterSize = oRow.getAttribute("masParameterSize")
						sCategoryName = oRow.getAttribute("catName")
						sMasLongName = oRow.getAttribute("masLongName")
						sRptStoreID = oRow.getAttribute("RptStoreID")

						sParamString = "'" & sReportType & "', '" & sstName & "', '" & sMasID & "', '" & sMasShortName & "', '" & sMasParameterURL & "', '" & sMasParameterSize & "', '" & sCategoryName & "', '" & sMasLongName & "', '" & sRptStoreID & "'"

						if sReportType = "OnDemandParameters" then
							sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label= ""Generate " & sMasShortName & """ action=""doPrintRpt(" & sParamString & ");"" description="" ""/>"
						elseif oRow.getAttribute("ReportType") = "MostRecent" and sRptStoreID <> "0" then
							sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label= ""View Latest " & sMasShortName & """ action=""doPrintRpt(" & sParamString & ");"" description="" ""/>"
						end if
					next
					'sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Business Model Settings"" action=""top.gbSkipSetupCheck=true;top.NavNext('/rents/internalsettings/xpagesetinternalsettings.htm','','','NEXT:ViewOnly=edit')"" description=""""/>"
					sTempReturn = sTempReturn & "</subcategory>"
					sTempReturn = sTempReturn & "</category>"
				end if
			end if

			sTempReturn = sTempReturn & "<category label=""Third Party"">"
%>
			<!-- #include virtual='/shell/homepages/setupHomeInitialBLIncludes/ThirdParty.asp' -->
<%
			sTempReturn = sTempReturn & "</category>"
		end if
		sTempReturn = sTempReturn & "<DataAdapter>" & strXML2 & "</DataAdapter><RsGSSelect>" & strXML3 & "</RsGSSelect>"

		if bIsTemplate = "1" then
			sTempReturn = sTempReturn & "<ReportInfo>" & strXML4 & "</ReportInfo>"
		end if  ' end if bIsTemplate = 1

		set oXML = nothing
		set oRow = nothing

		strReturn = "<Setup title=''>" & sTempReturn & "</Setup>"
		doBusinessLogic = 0
	Else
		' set the server global variable for retrieving the roles
		gINFdbMachine	= GetKeyword("dbmachine") 'ToDo : Comment this line as gINFdbMachine is already set in the BusinessLogicServer.inc
		'DVPrasad defect#-203383 Use PRIMARYNODE as the constant name for the linked server
		'gINFsmMachine = GetKeyword("smmachine")
		gINFsmMachine = "PRIMARYNODE"

		dim localRents : localRents = 0
		dim localSDE : localSDE = 0
		dim ReportDBExistFlag : ReportDBExistFlag = 0

		'Get a list of active centers for the company
		strSP = "exec uspMcoEditCenterSelect "	& _
			"@InternalEntityId = '" & strEntityID & "', " & _
			"@InternalUserId = '" & strUserID & "', " & _
			"@InternalSiteId = '" & strSiteID & "', " & _
			"@IPVC_ENTITYID = '" & strEntityID & "'"
		If GetSQLXML(strEntityID,"SiteMaster",strSP, strXML) = False Then
			strReturn = "<userMsg>Failed to get the list of active centers.</userMsg><techMsg>Proc executed: " & strSP & VbCrLf & " Result: " & strXML & " </techMsg>"
			doBusinessLogic = -1
			Exit Function
		End If

		Set oXML=Server.CreateObject("Microsoft.XMLDOM")
		oXML.async=false
		oXML.loadXML("<root>"&strXML&"</root>")
		'Check for the centers Leasing and Rents and SDE to be turned on
		set oRowXML=oXML.selectSingleNode("//Row[@oneID='12']")
		if not oRowXML is nothing then
			localRents = oRowXML.getAttribute("activeBit")
		End If
		set oRowXML=oXML.selectSingleNode("//Row[@oneID='19']")
		if not oRowXML is nothing then
			localSDE = oRowXML.getAttribute("activeBit")
		End If

		' Get CompanyLookup entries
		strSP = "select top 1 isnull(RCRDBServer,'') as RCRDBServer from [" & gINFsmMachine & "].SiteManager.dbo.CompanyLookup with (NOLOCK) where cmpny_id = " & strEntityID
		strResult = GetSQLXML(strSiteID,"SiteMaster", strSP, strXMLReturn)

		' Handle missing PMC entry in CompanyLookup
		if (strResult = false) or (strXMLReturn = "") then
			strReturn = "<root><CentralReporting_Error>" + "CompanyLookup.CMPNY_ID (" + strEntityID + ") - The entry is missing for this PMC.</CentralReporting_Error></root>"
			doBusinessLogic = 0
			exit function
		end if

		' Load the XML for servers
		set xmlObj=server.CreateObject("Microsoft.XMLDOM")
		xmlObj.async=false
		xmlObj.loadXML(strXMLReturn)
		set xmlObj = xmlObj.selectSingleNode("//Row")
		'------------CENTRAL REPORTING CHANGES BEGIN------------------------------------------------------
		' Check SetupOptions if the customdata import flag is set	. Based on this flag show the Custom Data Links
		if xmlObj.attributes.getNamedItem("RCRDBServer").value <> "" then
			gINFdbConn.Open("Provider=SQLOLEDB;Server=" & xmlObj.attributes.getNamedItem("RCRDBServer").value & ";Database=" & _
			"R" & strEntityID & ";uid=" & GetKeyword("dbtemplateuser") & ";pwd=" & GetKeyword("dbtemplatepassword"))
			IF gINFdbConn.state=1 THEN
				ReportDBExistFlag=1
				' Get CustomDataFlag Entry
				strSP13 = "select CustomDataImportFlag, CompanyKPILibraryFlag from R" & strEntityID & "..SetupOption with(NOLOCK)"
				strResult = GetSQLXML("","", strSP13, strXMLReturn10)
				if (strResult = false) then
					strReturn = strXMLReturn10
					doBusinessLogic = -1
					exit function
				end if
				set xmlCustomDataImport = server.CreateObject("Microsoft.XMLDOM")
				xmlCustomDataImport.async = false
				xmlCustomDataImport.loadXML("<checkCustomData>" + strXMLReturn10 + "</checkCustomData>")
				sCDIFlag=xmlCustomDataImport.selectSingleNode("//Row/@CustomDataImportFlag").nodeValue
				sCKPIFlag=xmlCustomDataImport.selectSingleNode("//Row/@CompanyKPILibraryFlag").nodeValue
			END IF
		END IF

		' Select All the Custom Data import Templetes for this PMC
		if xmlObj.attributes.getNamedItem("RCRDBServer").value <> "" then
			gINFdbConn.Open("Provider=SQLOLEDB;Server=" & xmlObj.attributes.getNamedItem("RCRDBServer").value & ";Database=" & _
				"R" & strEntityID & ";uid=" & GetKeyword("dbtemplateuser") & ";pwd=" & GetKeyword("dbtemplatepassword"))
			IF gINFdbConn.state=1 THEN
				ReportDBExistFlag=1
				strSP12 = ""
				strSP12 = "select id as id,id as templateID,name as label,isnull(Description,'') as description,'true' as enabled from R" & strEntityID & "..CustomTemplate with (NOLOCK) where deleteflag=0"
				str11=strEntityID
				strResult = GetSQLXML("","", strSP12, strXMLReturn9)
				if (strResult = false) then
					strReturn = strXMLReturn9
					doBusinessLogic = -1
					exit function
				end if
				strXMLReturn9=Replace(strXMLReturn9,"<Row ","<linkEditDelete ")
			END IF
		END IF
		'''''''''''''''''''''''CENTRAL REPORTING CHANGES END''''''''''''''''''''''''''''''''''''''
		'OneSite Budgeting
		if bBudgeting="1" then
	%>
			<!-- #include file='../../shell/homepages/setupHomeInitialBLIncludes/budgeting.asp' -->
	<%
		end if
		'End OneSite Budgeting

		'Central Reporting
		'''''hiding for aug
		if bCentRepLegacy=0 then ' Added KSampath for defect 77350
			if aright("SetupReporting") then
				sTempReturn = sTempReturn & "<category label=""Central Reporting"">"
				sTempReturn = sTempReturn & "<item label=""General settings"">"
				sTempReturn = sTempReturn & "<linkHide id=""" & increment(pgID) & """ label=""Enter property information"" action=""openCustomRangeModal('property', true);"" description=""Set property information such as physical attributes, management levels, and reporting groups""/>"
				if ((aright("AdministerReporting") or ARight("AddCompany")) and sCKPIFlag="True" and bcentRepAdv=1 ) then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Company formulas"" action=""openCustomRangeModal('companyformula', true);"" description=""Add or edit company specific custom KPI's""/>"
				end if
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Establish grouping options"" action=""openCustomRangeModal('reporting', true);"" description=""Establish standard groups, create custom groups, and assign properties to them""/>"

				'laxman prasad #174666 UIChanges
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Global property filter"" action=""openCustomRangeModal('globalpropertyfilter', true);"" description=""Exclude the selected properties on all reports""/>"
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Hide RealPage Standard"" action=""openCustomRangeModal('RPStandard', true);"" description=""Hide RealPage Standard portfolio level reports and views from users""/>"
				sTempReturn = sTempReturn & "<linkHide id=""" & increment(pgID) & """ label=""Set week end day"" action=""openCustomRangeModal('week', true);"" description=""Select the week end day of the company for reporting purposes""/>"
				sTempReturn = sTempReturn & "</item>"
				'Added Ksampath for On Demand Refresh
				if aright("RefreshReporting") then
					sTempReturn = sTempReturn & "<item label=""Update property data"">"
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""On demand refresh"" action=""openPropertyRefreshModal();"" description=""Refresh reporting data""/>"
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Schedule refresh"" action=""openScheduleRefreshModal();"" description=""Schedule refresh for data""/>"
					sTempReturn = sTempReturn & "</item>"
				end if

				if aright("PublishReporting") then
					sTempReturn = sTempReturn & "<item label=""Publish"">"
					'llumpkins PCR#203991 Clean up UI for Publish reports modal
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Publish reports"" action=""openPublishReports();"" description=""Publish My Favorite and RealPage Standard reports.""/>"
					sTempReturn = sTempReturn & "</item>"
				end if

				' FOR Custom Data Import Check ReportDBExist and user had "AdministerReporting" Rolw and CustomDataInputFlag=1 in SetupTable and bcentRepAdv=1
				if  ReportDBExistFlag=1 and aright("AdministerReporting")  and sCDIFlag="True"  and bcentRepAdv=1  then
					sTempReturn = sTempReturn & "<itemExpandibles label=""Custom data import "">"
					'laxman prasad PCR#175386  Move the link for Establish Custom Input Columns into under Custom Data import Management section
					sTempReturn = sTempReturn & "<expandible id=""" & increment(pgID) & """ label=""Management"" action=""openAddCustomInputColumnsModal();"" description=""Manage templates for defining imports"" showByDefault=""false"">"
					'Pradeep PCR#179243. SEPT SYNC - Modify name and position of Establish Custom Input Columns link
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Create or Edit Custom Input Columns"" action=""openAddCustomInputColumnsModal();"" description=""Add or edit the custom input columns""/>"
					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""Create Template"" action=""openCreateTemplateModal();"" description=""Create a new template""/>"
					sTempReturn = sTempReturn & "<expandible id=""" & increment(pgID) & """ label=""Templates"" description="""" showByDefault=""false"" subsection=""1"">"
					sTempReturn = sTempReturn & strXMLReturn9
					sTempReturn = sTempReturn & "</expandible></expandible>"
					sTempReturn = sTempReturn & "<expandible id=""" & increment(pgID) & """ label=""Tools"" action=""openScheduleRefreshModal();"" description=""Access tools to aid in the setup of imports"" showByDefault=""false"">"
					'Pradeep PCR#172061. Modifications for CDIT from Beta Testing
					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""Calendar Data Example (CSV)"" action=""doDownloadSampleCalendarCSV(this);"" description=""Download an example CSV data file for Calendar Period.""/>"

					'DVPrasad 170550 Rework XML Data Example
					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""Calendar Data Example (XML)"" action=""doDownloadSampleCalendarXML(this);"" description=""Download an example XML data file for Calendar Period.""/>"

					'Defect 170548 : Hide Data Example (XML)
					'Pradeep PCR#172061. Modifications for CDIT from Beta Testing

					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""Fiscal Data Example (CSV)"" action=""doDownloadSampleFiscalCSV(this);"" description=""Download an example CSV data file for Fiscal Period.""/>"
					'DVPrasad 170550 Rework XML Data Example
					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""Fiscal Data Example (XML)"" action=""doDownloadSampleFiscalXML(this);"" description=""Download an example XML data file for Fiscal Period.""/>"
					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""Property List"" action=""doPropertyList();"" description=""Get a list of properties along with their OneSite ID""/>"
					sTempReturn = sTempReturn & "</expandible>"
					sTempReturn = sTempReturn & "<expandible id=""" & increment(pgID) & """ label=""Operations"" action=""openScheduleRefreshModal();"" description=""Import data and view logs"" showByDefault=""false"">"
					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""Import Custom Data"" action=""doImportCustomData();"" description=""Import custom data into Central Reporting""/>"
					sTempReturn = sTempReturn & "  <link id=""" & increment(pgID) & """ label=""View data import log"" action=""doViewDataImportLog();"" description=""View the history logs for previous imports""/>"
					sTempReturn = sTempReturn & "</expandible>"
					sTempReturn = sTempReturn & "</itemExpandibles>"
				end if
				sTempReturn = sTempReturn & "</category>"
			end if
		end if

		' DVPrasad Defect#150984,153211 UDS link enable under setup where UDS bit is 1
		' UDS data model
		if bUDS = 1 then
			sTempReturn = sTempReturn & "<category label=""UDS"">"
			sTempReturn = sTempReturn & "<item label=""Data Model"">"
			sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""View UDS data model"" action=""openUDSDataModel();"" description=""Browse data diagrams and structures of the UDS database.""/>"
			sTempReturn = sTempReturn & "</item>"
			sTempReturn = sTempReturn & "</category>"
		end if

		'Defect# 150984,153211 code end
		if bDocumentManagement = "1" or bSmartApp = "1" then
			if aright("43viewdocmgtsetup") or aright("62viewdocmgtsetup") then
				sTempReturn = sTempReturn & "<category label=""Document management"">"
				sTempReturn = sTempReturn & "<item label="""">"
				if aright("43viewformslibrary") or aright("52viewformslibrary") or aright("62viewformslibrary") or aright("43viewonlyformslibrary") or aright("62viewonlyformslibrary") then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Forms library (Manage letters and notices)"" action=""javascript:top.checkLink(window.event);top.NavNext('/documentmanagement/xpagesetdocmgtlibraries.asp','');"" description=""Manage standard and custom forms and letters""/>"
				end if
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Merge fields"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/documentmanagement/Forms/modalMergeFields.htm','650','350');"" description=""Manage merge fields""/>"
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Packet library"" action=""javascript:top.checkLink(window.event);top.NavNext('/documentmanagement/xpagesetdocmgtlibraries.asp','/documentmanagement/PacketTemplate/PacketLibrary.htm')"" description=""Create new packets and edit existing packets""/>"
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Manage document types"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/DocumentManagement/DocumentTypes/modalDocumentTypes.htm','690','390',false,window,null,null,null,null,{});"" description=""Create and manage document types""/>"
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Constraints"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/DocumentManagement/Constraints/modalConstraints.htm','690','390',false,window,null,null,null,null,{});"" description=""View, create, and edit constraints""/>"

				if aright("43bluemoonfeaturebitadmin") or aright("52bluemoonfeaturebitadmin") or aright("62bluemoonfeaturebitadmin") then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Blue Moon feature bit"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/documentmanagement/Forms/modalBlueMoonAssignment.htm','650','350');"" description=""Enabled or disabled Blue Moon feature bit for multiple properties""/>"
				end if
				
			    sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Blue Moon merge fields"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/documentmanagement/Forms/modalBlueMoonTemplate.htm','650','350');"" description=""Define Blue Moon merge fields for properties""/>"
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Property Storage Usage Summary"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/DocumentManagement/Setup/modalStorageReport.htm','800','650');"" description=""View Property Storage Usage Summary""/>"
                sTempReturn = sTempReturn & "</item>"
				sTempReturn = sTempReturn & "</category>"
			end if
		end if

		if bLeasingDeskeForms = "1" then
			if aright("52viewdocmgtsetup") then
				sTempReturn = sTempReturn & "<category label=""LeasingDesk eForms"">"
				sTempReturn = sTempReturn & "<item label="""">"
				if aright("43viewformslibrary") or aright("52viewformslibrary") or aright("62viewformslibrary") then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Forms library (Manage letters and notices)"" action=""javascript:top.checkLink(window.event);top.NavNext('/documentmanagement/xpagesetdocmgtlibraries.asp','');"" description=""Manage standard and custom forms and letters""/>"
				end if
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Merge fields"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/documentmanagement/Forms/modalMergeFields.htm','650','350');"" description=""Manage merge fields""/>"
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Packet library"" action=""javascript:top.checkLink(window.event);top.NavNext('/documentmanagement/xpagesetdocmgtlibraries.asp','/documentmanagement/PacketTemplate/PacketLibrary.htm')"" description=""Create new packets and edit existing packets""/>"
				sTempReturn = sTempReturn & "</item>"
				sTempReturn = sTempReturn & "</category>"
			end if
		end if

		'General Settings roopa
		if aright("accesscoaglobalupdates") or aright("12customletters") or aright("templates") then
			pgID = 0
			sTempReturn = sTempReturn & "<category label=""General settings"">"
			sTempReturn = sTempReturn & "<item label="""">"
			sTempReturn = sTempReturn & "<link enabled=""" & aright("companysetup") & """ id=""" & increment(pgID) & """ label=""General information and company settings"" action=""top.NavModalOpen_SiteModal(" & strEntityID & ",0,'/shell/homepages/CompanySetupHomeModal.htm?ModalHomePage=1', 950, 753)"" description=""General information and company settings""/>"
			sTempReturn = sTempReturn & "</item>"
			if aright("12customletters")=true then
				sTempReturn = sTempReturn & "<item label="""">"
				if bFormsLibrary <> "1" then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Manage letters and notices"" action=""javascript:top.checkLink(window.event);top.NavStart('/lettersnoticesserverside/xpagesetlettersandnoticesserverside.htm');"" description=""Manage standard and custom forms and letters""/>"
				else
					if aright("43viewformslibrary") or aright("52viewformslibrary") or aright("62viewformslibrary") then
						sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Manage letters and notices"" action=""javascript:top.checkLink(window.event);top.NavNext('/documentmanagement/xpagesetdocmgtlibraries.asp','/documentmanagement/forms/forms.htm');"" description=""Manage standard and custom forms and letters""/>"
					end if
				end if
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Merge fields"" action=""javascript:top.checkLink(window.event);top.NavModalOpen('/documentmanagement/Forms/modalMergeFields.htm','650','350');"" description=""Manage merge fields""/>"
				sTempReturn = sTempReturn & "</item>"
			end if
			sTempReturn = sTempReturn & "<item label="""">"
			sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Unit designation assignment"" action=""PageState_Current('SubjectArea')='UnitDesignation';top.NavModalOpen('/coreglobal/datatranslation/modalDataTranslationMap.htm',500,500,false,window,'','','',true);"" description=""Assign all property unit designations to a standardized Central Reporting list""/>"
			if aright("accesscoaglobalupdates") then
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Update settings (chart of accounts)"" action=""javascript:top.checkLink(window.event);top.NavStart('/coreglobal/globalupdates/xpagesetglobalupdates.htm');"" description=""Update chart of Accounts for the company""/>"
			end if
			sTempReturn = sTempReturn & "</item>"
			sTempReturn = sTempReturn & "<item label="""">"
			sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""3rd Party PMS Category"" action=""javascript:top.checkLink(window.event);top.NavStart('/coreglobal/managecompany/3rdparty/xpagesetPMSCategoryList.htm');"" description=""Manage 3rd Party PMS Categories""/>"
			sTempReturn = sTempReturn & "</item>"
			'Leasingdesk Ins Services 204138 sharnekar 07/08/09
			if bRentersInsurance = "1" then
				sTempReturn = sTempReturn & "<item label="""">"
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""LeasingDesk Insurance Services Settings"" action=""javascript:top.checkLink(window.event);top.NavStart('/coreglobal/managecompany/InsuranceSvc/xpagesetManageInsSvcSettings.htm');"" description=""Maintain and Customize 3rd party Insurance Providers List""/>"
				sTempReturn = sTempReturn & "</item>"
			end if
			sTempReturn = sTempReturn & "</category>"
		end if

		'Users  roopa --- added additional granular rights 5/10/06 CFORD DEFECT: 96588
		'START:128428
		if  aright("usermanagement") or aright("umUsers") or aright("umUSP") then
			'END
			pgID = 0
			sTempReturn = sTempReturn & "<category label=""Users "">"
			sTempReturn = sTempReturn & "<item label="""">"
			if aright("usermanagement") or aright("umUsers")  then
				if  aright("1LimitAccessInternalSetup") then
					sTempReturn = sTempReturn & "<link enabled=""" & aright("umUsers") & """ id=""" & increment(pgID) & """ label=""Users"" action=""top.checkLink(window.event);top.NavStart('/coreglobal/usermanagement/xpagesetonesiteusers.htm');"" description=""Manage user accounts to setup and control secure access to OneSite""/>"
				else
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Users"" action=""top.checkLink(window.event);top.NavStart('/coreglobal/usermanagement/xpagesetonesiteusers.htm');"" description=""Manage user accounts to setup and control secure access to OneSite""/>"
				end if
			end if
			if aright ("usermanagement") or aright("umUSP") then
				if aright("1LimitAccessInternalSetup") then
					sTempReturn = sTempReturn & "<link enabled=""" & aright("umUSP") & """ id=""" & increment(pgID) & """ label=""Users Security Policy"" action=""top.checkLink(window.event);top.NavStart('/coreglobal/usermanagement/xpagesetsecuritypolicy.htm');"" description=""Set security policy for user passwords for all properties""/>"
				else
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Users Security Policy"" action=""top.checkLink(window.event);top.NavStart('/coreglobal/usermanagement/xpagesetsecuritypolicy.htm');"" description=""Set security policy for user passwords for all properties""/>"
				end if
			end if
			sTempReturn = sTempReturn & "</item>"
			sTempReturn = sTempReturn & "</category>"
		end if
		'START:128428
		if  aright("usermanagement") or aright("umUSP") then
			pgID = 0
			sTempReturn = sTempReturn & "<category label=""Roles "">"
			sTempReturn = sTempReturn & "<item label="""">"
			if aright("usermanagement") or aright("umRoles") then
				sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Manage Roles"" action=""javascript:top.checkLink(window.event);top.NavStart('/coreglobal/manageroles/xpagesetmanageroles.htm');"" description=""Create and manage custom user roles that can be assigned to users of the company""/>"
			end if
			sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Search Roles and Rights"" action=""top.checkLink(window.event);top.NavModalOpen('/coreglobal/ManageRoles/SearchRole/ViewRoleRightsModal.htm','400','190')"" description=""Search list of rights associated to roles, list of roles associated to rights""/>"
			sTempReturn = sTempReturn & "</item>"
			sTempReturn = sTempReturn & "</category>"
		end if
		'END
		'Setup roopa
		if aright("addcompany") or aright("1LimitAccessInternalSetup") then
			pgID = 0
			sTempReturn = sTempReturn & "<category label=""Internal setup"">"
			if aright("templates") or aright("addproperty") then
				sTempReturn = sTempReturn & "<item label=""Business Models/templates"">"
				if aright("templates") or aright("addproperty") then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Business Models"" action=""top.checkLink(window.event);top.NavStart('/coreglobal/companysetup/xpagesetpropertytemplatesNew.asp');"" description=""Establish Business Models to be used when setting up new sites""/>"
				end if
				sTempReturn = sTempReturn & "</item>"
			end if

			if aright("addcompany") or aright("accesscoaglobalupdates") then
				sTempReturn = sTempReturn & "<item label=""Company setup"">"
				if aright("addcompany") then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Manage company"" action=""javascript:PageState_Current('ShowOwner') = '1';top.checkLink(window.event);top.NavModalOpen('/coreglobal/ManageCompany/EditCompany/companyList.htm',540,870);"" description=""Update settings for an existing company""/>"
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""New company"" action=""javascript:PageState_Current('isOwner') = '0';top.checkLink(window.event);top.NavModalOpen('/coreglobal/managecompany/newcompany/newcompanywizard.htm',500,558);"" description=""Create new company""/>"
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""New Owner"" action=""javascript:PageState_Current('isOwner') = '1';top.checkLink(window.event);top.NavModalOpen('/coreglobal/managecompany/newcompany/newcompanywizard.htm',500,558);"" description=""Create new owner""/>"
				else
					sTempReturn = sTempReturn & "<link enabled=""" & aright("addcompany") & """ id=""" & increment(pgID) & """ label=""Manage company"" action=""javascript:PageState_Current('ShowOwner') = '1';top.checkLink(window.event);top.NavModalOpen('/coreglobal/ManageCompany/EditCompany/companyList.htm',540,870);"" description=""Update settings for an existing company""/>"
					sTempReturn = sTempReturn & "<link enabled=""" & aright("addcompany") & """ id=""" & increment(pgID) & """ label=""New company"" action=""javascript:PageState_Current('isOwner') = '0';top.checkLink(window.event);top.NavModalOpen('/coreglobal/managecompany/newcompany/newcompanywizard.htm',500,558);"" description=""Create new company""/>"
					sTempReturn = sTempReturn & "<link enabled=""" & aright("addcompany") & """ id=""" & increment(pgID) & """ label=""New Owner"" action=""javascript:PageState_Current('isOwner') = '1';top.checkLink(window.event);top.NavModalOpen('/coreglobal/managecompany/newcompany/newcompanywizard.htm',500,558);"" description=""Create new owner""/>"
				end if
				if aright("accesscoaglobalupdates") then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Update settings (chart of accounts)"" action=""javascript:top.checkLink(window.event);top.NavStart('/coreglobal/globalupdates/xpagesetglobalupdates.htm');"" description=""Update chart of Accounts for the company""/>"
				end if
				sTempReturn = sTempReturn & "</item>"
			end if

			if aright("templates") then
				sTempReturn = sTempReturn & "<item label=""Migrations"">"
				if aright("templates") or aright("addproperty") then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Migrate from template to Business Model"" action=""top.checkLink(window.event);top.NavStart('/coreglobal/companysetup/xpagesetTemplateBMMigration.asp');"" description=""Migrate from corporate template to new Business Model tool""/>"
				end if
				if aright("addproperty")=true then
					sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""Migrate Screening sites to 3.5"" action=""javascript:top.checkLink(window.event);top.NavStart('/migrations/scr_migration.htm');"" description=""Migrate Screening site from 3.1 to the latest version.""/>"
				end if
				sTempReturn = sTempReturn & "</item>"
			end if

			if aright("addproperty") or aright("templates") then
				sTempReturn = sTempReturn & "<item label=""Property setup"">"
				sTempReturn = sTempReturn & "<link enabled=""" & aright("addproperty") & """ id=""" & increment(pgID) & """ label=""Manage property"" action=""top.checkLink(window.event);top.NavStart('/coreglobal/manageproperty/xpagesetlistproperties.htm');"" description=""Update settings for an existing property""/>"
				sTempReturn = sTempReturn & "<link enabled=""" & aright("addproperty") & """ id=""" & increment(pgID) & """ label=""New property"" action=""top.NavModalOpen('/coreglobal/manageproperty/newproperty/newpropertywizard.htm',555,520);"" description=""Create a new property""/>"
				'Defect 90559 hide this link as requested.
				sTempReturn = sTempReturn & "</item>"
			end if

			'Removed the check for the screening center as this setup page needs to always be available in order to access rental history settings.
			'The subsequent page will then check for the screening center and restrict what settings are available based on the center being enabled.
			sTempReturn = sTempReturn & "<item label=""LeasingDesk"">"
			sTempReturn = sTempReturn & "<link id=""" & increment(pgID) & """ label=""LeasingDesk Internal settings"" action=""javascript:top.checkLink(window.event);top.NavNext('/screening/xpagesetScreeningSetup.htm','')"" description=""Edit internal settings for Rental History collection and usage.""/>"
			sTempReturn = sTempReturn & "</item>"
			sTempReturn = sTempReturn & "</category>"
		end if
		strReturn = "<Setup title=''>" & sTempReturn & "</Setup>"
		doBusinessLogic = 0
	End If
end function

'-------------------------------------------------------------------
'Purpose: Parses XML object for parameter fields
'-------------------------------------------------------------------
Function ParseFields(objXML)
	sScreenVer = SafeGetXMLAttribute(objXML,"//Setup/@screenVer" )
	bNewResFromUI = SafeGetXMLAttribute(objXML,"//Setup/@newRes" )
	bFromCentral = SafeGetXMLAttribute(objXML,"//Setup/@fromCentral" )
End Function

function increment(var)
	var = var + 1
	increment=var
end function
%>
